Optimal. Leaf size=87 \[ \frac{b^2 \text{PolyLog}\left (2,1-\frac{2}{1-\frac{c}{x}}\right )}{c}-\frac{\left (a+b \coth ^{-1}\left (\frac{x}{c}\right )\right )^2}{c}-\frac{\left (a+b \coth ^{-1}\left (\frac{x}{c}\right )\right )^2}{x}+\frac{2 b \log \left (\frac{2}{1-\frac{c}{x}}\right ) \left (a+b \coth ^{-1}\left (\frac{x}{c}\right )\right )}{c} \]
[Out]
________________________________________________________________________________________
Rubi [B] time = 0.506839, antiderivative size = 205, normalized size of antiderivative = 2.36, number of steps used = 28, number of rules used = 12, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.75, Rules used = {6099, 2454, 2389, 2296, 2295, 6715, 2430, 43, 2416, 2394, 2393, 2391} \[ \frac{b^2 \text{PolyLog}\left (2,-\frac{c-x}{2 x}\right )}{2 c}-\frac{b^2 \text{PolyLog}\left (2,\frac{c+x}{2 x}\right )}{2 c}-\frac{b \log \left (\frac{c+x}{2 x}\right ) \left (2 a-b \log \left (1-\frac{c}{x}\right )\right )}{2 c}-\frac{b \log \left (\frac{c+x}{x}\right ) \left (2 a-b \log \left (1-\frac{c}{x}\right )\right )}{2 x}+\frac{\left (1-\frac{c}{x}\right ) \left (2 a-b \log \left (1-\frac{c}{x}\right )\right )^2}{4 c}-\frac{b^2 \left (\frac{c}{x}+1\right ) \log ^2\left (\frac{c+x}{x}\right )}{4 c}-\frac{b^2 \log \left (-\frac{c-x}{2 x}\right ) \log \left (\frac{c+x}{x}\right )}{2 c} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
Rule 6099
Rule 2454
Rule 2389
Rule 2296
Rule 2295
Rule 6715
Rule 2430
Rule 43
Rule 2416
Rule 2394
Rule 2393
Rule 2391
Rubi steps
\begin{align*} \int \frac{\left (a+b \tanh ^{-1}\left (\frac{c}{x}\right )\right )^2}{x^2} \, dx &=\int \left (\frac{\left (2 a-b \log \left (1-\frac{c}{x}\right )\right )^2}{4 x^2}+\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (1+\frac{c}{x}\right )}{2 x^2}+\frac{b^2 \log ^2\left (1+\frac{c}{x}\right )}{4 x^2}\right ) \, dx\\ &=\frac{1}{4} \int \frac{\left (2 a-b \log \left (1-\frac{c}{x}\right )\right )^2}{x^2} \, dx+\frac{1}{2} b \int \frac{\left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (1+\frac{c}{x}\right )}{x^2} \, dx+\frac{1}{4} b^2 \int \frac{\log ^2\left (1+\frac{c}{x}\right )}{x^2} \, dx\\ &=-\left (\frac{1}{4} \operatorname{Subst}\left (\int (2 a-b \log (1-c x))^2 \, dx,x,\frac{1}{x}\right )\right )-\frac{1}{2} b \operatorname{Subst}\left (\int (2 a-b \log (1-c x)) \log (1+c x) \, dx,x,\frac{1}{x}\right )-\frac{1}{4} b^2 \operatorname{Subst}\left (\int \log ^2(1+c x) \, dx,x,\frac{1}{x}\right )\\ &=-\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (\frac{c+x}{x}\right )}{2 x}+\frac{\operatorname{Subst}\left (\int (2 a-b \log (x))^2 \, dx,x,1-\frac{c}{x}\right )}{4 c}-\frac{b^2 \operatorname{Subst}\left (\int \log ^2(x) \, dx,x,1+\frac{c}{x}\right )}{4 c}+\frac{1}{2} (b c) \operatorname{Subst}\left (\int \frac{x (2 a-b \log (1-c x))}{1+c x} \, dx,x,\frac{1}{x}\right )+\frac{1}{2} \left (b^2 c\right ) \operatorname{Subst}\left (\int \frac{x \log (1+c x)}{1-c x} \, dx,x,\frac{1}{x}\right )\\ &=\frac{\left (1-\frac{c}{x}\right ) \left (2 a-b \log \left (1-\frac{c}{x}\right )\right )^2}{4 c}-\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (\frac{c+x}{x}\right )}{2 x}-\frac{b^2 \left (1+\frac{c}{x}\right ) \log ^2\left (\frac{c+x}{x}\right )}{4 c}+\frac{b \operatorname{Subst}\left (\int (2 a-b \log (x)) \, dx,x,1-\frac{c}{x}\right )}{2 c}+\frac{b^2 \operatorname{Subst}\left (\int \log (x) \, dx,x,1+\frac{c}{x}\right )}{2 c}+\frac{1}{2} (b c) \operatorname{Subst}\left (\int \left (\frac{2 a-b \log (1-c x)}{c}-\frac{2 a-b \log (1-c x)}{c (1+c x)}\right ) \, dx,x,\frac{1}{x}\right )+\frac{1}{2} \left (b^2 c\right ) \operatorname{Subst}\left (\int \left (-\frac{\log (1+c x)}{c}-\frac{\log (1+c x)}{c (-1+c x)}\right ) \, dx,x,\frac{1}{x}\right )\\ &=-\frac{a b}{x}-\frac{b^2}{2 x}+\frac{\left (1-\frac{c}{x}\right ) \left (2 a-b \log \left (1-\frac{c}{x}\right )\right )^2}{4 c}+\frac{b^2 \left (1+\frac{c}{x}\right ) \log \left (\frac{c+x}{x}\right )}{2 c}-\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (\frac{c+x}{x}\right )}{2 x}-\frac{b^2 \left (1+\frac{c}{x}\right ) \log ^2\left (\frac{c+x}{x}\right )}{4 c}+\frac{1}{2} b \operatorname{Subst}\left (\int (2 a-b \log (1-c x)) \, dx,x,\frac{1}{x}\right )-\frac{1}{2} b \operatorname{Subst}\left (\int \frac{2 a-b \log (1-c x)}{1+c x} \, dx,x,\frac{1}{x}\right )-\frac{1}{2} b^2 \operatorname{Subst}\left (\int \log (1+c x) \, dx,x,\frac{1}{x}\right )-\frac{1}{2} b^2 \operatorname{Subst}\left (\int \frac{\log (1+c x)}{-1+c x} \, dx,x,\frac{1}{x}\right )-\frac{b^2 \operatorname{Subst}\left (\int \log (x) \, dx,x,1-\frac{c}{x}\right )}{2 c}\\ &=-\frac{b^2}{x}-\frac{b^2 \left (1-\frac{c}{x}\right ) \log \left (1-\frac{c}{x}\right )}{2 c}+\frac{\left (1-\frac{c}{x}\right ) \left (2 a-b \log \left (1-\frac{c}{x}\right )\right )^2}{4 c}-\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (\frac{c+x}{2 x}\right )}{2 c}+\frac{b^2 \left (1+\frac{c}{x}\right ) \log \left (\frac{c+x}{x}\right )}{2 c}-\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (\frac{c+x}{x}\right )}{2 x}-\frac{b^2 \log \left (-\frac{c-x}{2 x}\right ) \log \left (\frac{c+x}{x}\right )}{2 c}-\frac{b^2 \left (1+\frac{c}{x}\right ) \log ^2\left (\frac{c+x}{x}\right )}{4 c}+\frac{1}{2} b^2 \operatorname{Subst}\left (\int \frac{\log \left (\frac{1}{2} (1-c x)\right )}{1+c x} \, dx,x,\frac{1}{x}\right )-\frac{1}{2} b^2 \operatorname{Subst}\left (\int \log (1-c x) \, dx,x,\frac{1}{x}\right )+\frac{1}{2} b^2 \operatorname{Subst}\left (\int \frac{\log \left (\frac{1}{2} (1+c x)\right )}{1-c x} \, dx,x,\frac{1}{x}\right )-\frac{b^2 \operatorname{Subst}\left (\int \log (x) \, dx,x,1+\frac{c}{x}\right )}{2 c}\\ &=-\frac{b^2}{2 x}-\frac{b^2 \left (1-\frac{c}{x}\right ) \log \left (1-\frac{c}{x}\right )}{2 c}+\frac{\left (1-\frac{c}{x}\right ) \left (2 a-b \log \left (1-\frac{c}{x}\right )\right )^2}{4 c}-\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (\frac{c+x}{2 x}\right )}{2 c}-\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (\frac{c+x}{x}\right )}{2 x}-\frac{b^2 \log \left (-\frac{c-x}{2 x}\right ) \log \left (\frac{c+x}{x}\right )}{2 c}-\frac{b^2 \left (1+\frac{c}{x}\right ) \log ^2\left (\frac{c+x}{x}\right )}{4 c}-\frac{b^2 \operatorname{Subst}\left (\int \frac{\log \left (1-\frac{x}{2}\right )}{x} \, dx,x,1-\frac{c}{x}\right )}{2 c}+\frac{b^2 \operatorname{Subst}\left (\int \frac{\log \left (1-\frac{x}{2}\right )}{x} \, dx,x,1+\frac{c}{x}\right )}{2 c}+\frac{b^2 \operatorname{Subst}\left (\int \log (x) \, dx,x,1-\frac{c}{x}\right )}{2 c}\\ &=\frac{\left (1-\frac{c}{x}\right ) \left (2 a-b \log \left (1-\frac{c}{x}\right )\right )^2}{4 c}-\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (\frac{c+x}{2 x}\right )}{2 c}-\frac{b \left (2 a-b \log \left (1-\frac{c}{x}\right )\right ) \log \left (\frac{c+x}{x}\right )}{2 x}-\frac{b^2 \log \left (-\frac{c-x}{2 x}\right ) \log \left (\frac{c+x}{x}\right )}{2 c}-\frac{b^2 \left (1+\frac{c}{x}\right ) \log ^2\left (\frac{c+x}{x}\right )}{4 c}+\frac{b^2 \text{Li}_2\left (-\frac{c-x}{2 x}\right )}{2 c}-\frac{b^2 \text{Li}_2\left (\frac{c+x}{2 x}\right )}{2 c}\\ \end{align*}
Mathematica [A] time = 0.0965751, size = 101, normalized size = 1.16 \[ \frac{-b^2 x \text{PolyLog}\left (2,-e^{-2 \tanh ^{-1}\left (\frac{c}{x}\right )}\right )+a \left (2 b x \log \left (\frac{1}{\sqrt{1-\frac{c^2}{x^2}}}\right )-a c\right )+2 b \tanh ^{-1}\left (\frac{c}{x}\right ) \left (b x \log \left (e^{-2 \tanh ^{-1}\left (\frac{c}{x}\right )}+1\right )-a c\right )+b^2 (x-c) \tanh ^{-1}\left (\frac{c}{x}\right )^2}{c x} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.004, size = 144, normalized size = 1.7 \begin{align*} -{\frac{{a}^{2}}{x}}-{\frac{{b}^{2}}{x} \left ({\it Artanh} \left ({\frac{c}{x}} \right ) \right ) ^{2}}-{\frac{{b}^{2}}{c} \left ({\it Artanh} \left ({\frac{c}{x}} \right ) \right ) ^{2}}+2\,{\frac{{b}^{2}}{c}{\it Artanh} \left ({\frac{c}{x}} \right ) \ln \left ({ \left ( 1+{\frac{c}{x}} \right ) ^{2} \left ( 1-{\frac{{c}^{2}}{{x}^{2}}} \right ) ^{-1}}+1 \right ) }+{\frac{{b}^{2}}{c}{\it polylog} \left ( 2,-{ \left ( 1+{\frac{c}{x}} \right ) ^{2} \left ( 1-{\frac{{c}^{2}}{{x}^{2}}} \right ) ^{-1}} \right ) }-2\,{\frac{ab}{x}{\it Artanh} \left ({\frac{c}{x}} \right ) }-{\frac{ab}{c}\ln \left ( 1-{\frac{{c}^{2}}{{x}^{2}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{1}{4} \,{\left (c^{3} \int -\frac{\log \left (x\right )^{2}}{c^{3} x^{2} - c x^{4}}\,{d x} + c^{2}{\left (\frac{\log \left (-c^{2} + x^{2}\right )}{c^{3}} - \frac{\log \left (x^{2}\right )}{c^{3}}\right )} - 4 \, c^{2} \int -\frac{x \log \left (c + x\right )}{c^{3} x^{2} - c x^{4}}\,{d x} + 2 \, c^{2} \int -\frac{x \log \left (x\right )}{c^{3} x^{2} - c x^{4}}\,{d x} + 2 \, c{\left (\frac{\log \left (-c + x\right )}{c^{2}} - \frac{\log \left (x\right )}{c^{2}} + \frac{1}{c x}\right )} \log \left (-\frac{c}{x} + 1\right ) - c{\left (\frac{\log \left (c + x\right )}{c^{2}} - \frac{\log \left (-c + x\right )}{c^{2}}\right )} - c \int -\frac{x^{2} \log \left (x\right )^{2}}{c^{3} x^{2} - c x^{4}}\,{d x} - 2 \, c \int -\frac{x^{2} \log \left (c + x\right )}{c^{3} x^{2} - c x^{4}}\,{d x} + 4 \, c \int -\frac{x^{2} \log \left (x\right )}{c^{3} x^{2} - c x^{4}}\,{d x} - \frac{\log \left (-\frac{c}{x} + 1\right )^{2}}{x} - \frac{c \log \left (c + x\right )^{2} - 2 \,{\left ({\left (c + x\right )} \log \left (c + x\right ) -{\left (c + x\right )} \log \left (x\right ) - c\right )} \log \left (-c + x\right )}{c x} - \frac{x \log \left (-c + x\right )^{2} + x \log \left (x\right )^{2} - 2 \,{\left (x \log \left (x\right ) - x\right )} \log \left (-c + x\right ) - 2 \, x \log \left (x\right ) + 2 \, c}{c x} - 2 \, \int -\frac{x^{3} \log \left (c + x\right )}{c^{3} x^{2} - c x^{4}}\,{d x} + 2 \, \int -\frac{x^{3} \log \left (x\right )}{c^{3} x^{2} - c x^{4}}\,{d x}\right )} b^{2} - \frac{a b{\left (\frac{2 \, c \operatorname{artanh}\left (\frac{c}{x}\right )}{x} + \log \left (-\frac{c^{2}}{x^{2}} + 1\right )\right )}}{c} - \frac{a^{2}}{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{b^{2} \operatorname{artanh}\left (\frac{c}{x}\right )^{2} + 2 \, a b \operatorname{artanh}\left (\frac{c}{x}\right ) + a^{2}}{x^{2}}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (a + b \operatorname{atanh}{\left (\frac{c}{x} \right )}\right )^{2}}{x^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (b \operatorname{artanh}\left (\frac{c}{x}\right ) + a\right )}^{2}}{x^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]